<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Availability extends Model
{
    protected $fillable = [
        'rentable_id', 'rentable_type', 'room_type_id', 'from', 'to', 'is_valid'
    ];
    // return a Order or a Booking model that depends on
    // which instance has it
    public function rentable(){
        return $this->morphTo();
    }

    public function room_type(){
        return $this->belongsTo(RoomType::class);
    }
}
